package com.example.demo.infra.employrepositoryimp;

import com.example.demo.api.Dto.EmployeeDto;
import com.example.demo.domain.entity.Employee;
import com.example.demo.infra.mapper.EmployeeMapper;
import com.example.demo.domain.repository.EmployeeRepository;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class EmployeeRepositoryImp implements EmployeeRepository {

    private final EmployeeMapper employeeMapper;

    public EmployeeRepositoryImp(EmployeeMapper employeeMapper) {

        this.employeeMapper = employeeMapper;
    }

    @Override
    public List<Employee> findEmployeeByCondition(Employee employee) {
        return employeeMapper.findEmployeeByCondition(employee);
    }

    @Override
    public Employee findEmployeeById(Integer employeeId) {
        return employeeMapper.findEmployeeById(employeeId);
    }

    @Override
    public Employee getEmployeeWithLeader(EmployeeDto employeeDto) {
        return employeeMapper.getEmployeeWithLeader(employeeDto);
    }

    @Override
    public List<Employee> getEmployeeList(EmployeeDto employeeDto) {
        return employeeMapper.getEmployeeList(employeeDto);
    }

    @Override
    public void updateEmployee(EmployeeDto employeeDto) {
        employeeMapper.updateEmployee(employeeDto);
    }

    @Override
    public void insertEmployee(EmployeeDto employeeDto) {
        employeeMapper.insertEmployee(employeeDto);
    }
}
